package com.mxpio.erp.common.inventory.entity;

import javax.persistence.*;

import com.mxpio.erp.common.jpa.model.LotKey;
import com.mxpioframework.security.entity.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_INV_LOT")
@Schema(description="批次")
@IdClass(LotKey.class)
public class Lot extends BaseEntity {

	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "LOT_NO_", updatable = false)
	@Schema(description = "批次号")
	private String lotNo;

	@Id
	@Column(name = "SUB_LOT_INDEX_", updatable = false)
	@Schema(description = "子批次索引号")
	private String subLotIndex;
	
	@Column(name = "LOT_STATUS_")
	@Schema(description = "批次状态")
	private String lotStatus;

	@Column(name = "INSPECTION_BILL_NO")//冗余字段，由批次反查质检单时使用
	@Schema(description = "质检单单号")
	private String inspectionBillNo;

	@Column(name = "ORIGIN_SUB_LOT_INDEX_")
	@Schema(description = "拆批来源索引")//追溯批次由那个索引拆批而来
	private String originSubLotIndex;
}
